<style type="text/css">
  .modal-lg{
	  width:50%;
  }

</style>

<div class="col-sm-12">
	<div class="panel panel-default">
		<div class="panel-body">
			<div class="form-group ">
				<div class="col-sm-12">
						<!--<label class="control-label pull-left">产品名称</label>-->
					<div class="col-sm-2">
						<input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name" ng-keyup="myKeyup($event)">
					</div>
						<!--<label class="control-label pull-left">产品编号</label>-->
					<div class="col-sm-2">
						<input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.code" ng-keyup="myKeyup($event)">
					</div>
						<!--<label class="control-label pull-left">选择景区</label>-->
					<div class="col-sm-2">
						<ui-select ng-model="searchform.place_code" theme="bootstrap" ng-keyup="myKeyup($event)">
							<ui-select-match placeholder="请选择一个景区">
								{{$select.selected.name}}
							</ui-select-match>
							<ui-select-choices repeat="item.code as item in viewarr | filter: $select.search">
								<span ng-bind-html="item.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
					</div>
					<div class="col-sm-2 ">
						<select class="form-control" ng-model="searchform.sale_category" ng-keyup="myKeyup($event)" ng-options="item.value as item.label for item in dictbytypelist">
							<option value="">--产品分类--</option>
	            		</select>
					</div>
					<!--<label class="control-label pull-left">产品状态</label>-->
					<div class="col-sm-2 ">
						<select class="form-control" ng-model="searchform.state" ng-keyup="myKeyup($event)">
							<option value="">--产品状态--</option>
							<option value="0">草稿</option>
							<option value="1">上架</option>
							<option value="2">下架</option>
	            		</select>
					</div>
					<!--<input type="text" class="form-control" ng-model="searchform.place_code">-->
					<a class="btn btn-info pull-right new" ng-click="create()">创建产品</a>
					<button type="submit" class="btn btn-default search pull-right" ng-click="load()">立即搜索</button>
				</div>
				<!--<div class="col-sm-2 text-right">-->
				<!--</div>-->
				<br/>
				<br/>
			</div>
			<div class="form-group">
				<div class="col-sm-12">
					<!--<label class="control-label pull-left">产品分类</label>-->
					<!--<div class="col-sm-2 ">
						<select class="form-control" ng-model="searchform.sale_category" ng-keyup="myKeyup($event)" ng-options="item.value as item.label for item in dictbytypelist">
							<option value="">--产品分类--</option>
	            		</select>
					</div>-->
					<!--<label class="control-label pull-left">产品状态</label>-->
					<!--<div class="col-sm-2 ">
						<select class="form-control" ng-model="searchform.state" ng-keyup="myKeyup($event)">
							<option value="">--产品状态--</option>
							<option value="0">草稿</option>
							<option value="1">上架</option>
							<option value="2">下架</option>
	            		</select>
					</div>-->
					<!--<button type="submit" class="btn btn-default search pull-right" ng-click="load()">立即搜索</button>-->
				</div>
			</div>
		</div>
	</div>
	<!-- searchArea -->


	<table class="table table-bordered">
		<thead>
			<tr>
				<th class="col-md-5 text-center">产品</th>
				<th class="col-md-2 text-center">产品分类</th>
				<th class="col-md-1 text-center">产品状态</th>
				<!--<th class="col-md-2 text-center">排序</th>-->
				<th class="col-md-1 text-center">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="obj in objs">
				<td class="">
					产品名称：{{obj.name_inside}}<br> 产品编号：{{obj.code}}
					<br> 成本价：{{obj.cost_price}} 元 / 指导价：{{obj.guide_price}} 元 / 市场价：{{obj.market_price}} 元
				</td>
				<td class="text-center">
					<br/> {{obj.sale_category_name}}
				</td>
				<td class="text-center">
					<span ng-show="obj.sale_apply_state_name == ''"><br/></span> {{obj.state_name}}
					<br/>
					<span ng-show="obj.sale_apply_state_name != ''" ng-bind="obj.sale_apply_state_name"></span>
				</td>
				<!--<td class="form-horizontal ">
          <div class="col-sm-6">
            <input class="form-control input-sm" 
            style="height:22px;" 
            type="text" 
            value="{{obj.asort}}" 
            ng-model="obj.asort">
          </div>
          <a ng-click="asort(obj.id, obj.asort)" class="btn btn-info btn-xs">gogo</a> 
        </td>-->
				<td class="text-center">
					<a ng-show="obj.state=='1'" ng-click="stop(obj.id)" class="btn btn-primary btn-xs">下架</a>
					<a ng-show="(obj.state=='0' || obj.state=='2') && obj.sale_apply_state != 'apply_sale'" ng-click="start(obj.id)" class="btn btn-danger btn-xs">申请上架</a>
					<a ng-click="edit(obj.id)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-success btn-xs">编辑</a>
					<a ng-click="del(obj.id)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-danger btn-xs">删除</a>
					<a ng-show="obj.used_state=='1'" ng-click="usedstart(obj.id)" class="btn btn-primary btn-xs">允许消票</a>
					<a ng-show="obj.used_state=='0'" ng-click="usedstop(obj.id)" class="btn btn-danger btn-xs">禁止消票</a>
					<a ng-click="info(obj.id)" ng-show="obj.state == '1' || obj.sale_apply_state == 'apply_sale'" class="btn btn-warning btn-xs">详情</a>
					<a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 1">分配经销商</a>
					<a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 0">分配不允许销售经销商</a>
					<a ng-click="skset(obj.code,obj.name,obj.guide_price, obj.cost_price)" class="btn btn-default btn-xs" ng-show="obj.sale_category_name == '正价票-商客' && obj.state == 1">商客专用设置</a>
					
				</td>
			</tr>
		</tbody>
	</table>


	<div class="text-right">

		<uib-pagination total-items="bigTotalItems" ng-model="bigCurrentPage" max-size="maxSize" class="pagination-sm" boundary-links="true"
		 ng-change="load()" items-per-page="itemsPerPage" previous-text="上一页" next-text="下一页" first-text="首页" last-text="末页" rotate="false">
		</uib-pagination>

	</div>


</div>